package com.tubi.Collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Collection4 {
    public static void main(String[] args) {
            Collection<String> arr = new ArrayList<>();
            arr.add("a");
            arr.add("b");
            arr.add("c");
            arr.add("d");
            arr.add("e");
            Iterator<String> it = arr.iterator();
            while (it.hasNext()){
                String next = it.next();
                if("b".equals(next)){
                    it.remove();
                }
            }
        System.out.println(arr);
      }
}
